package com.gaofans.vertx.boot.web.config;

import io.vertx.ext.web.handler.BodyHandler;

/**
 * bodyHandler的配置
 * @author GaoFans
 */
public class RequestBodyProperties {

    private long bodyLimit = BodyHandler.DEFAULT_BODY_LIMIT;

    private String uploadsDirectory = BodyHandler.DEFAULT_UPLOADS_DIRECTORY;

    private boolean mergeFormAttributes = BodyHandler.DEFAULT_MERGE_FORM_ATTRIBUTES;

    private boolean deleteUploadedFilesOnEnd = BodyHandler.DEFAULT_DELETE_UPLOADED_FILES_ON_END;

    private boolean preallocateBodyBuffer = BodyHandler.DEFAULT_PREALLOCATE_BODY_BUFFER;

    private boolean handleFileUploads = true;

    public long getBodyLimit() {
        return bodyLimit;
    }

    public void setBodyLimit(long bodyLimit) {
        this.bodyLimit = bodyLimit;
    }

    public String getUploadsDirectory() {
        return uploadsDirectory;
    }

    public void setUploadsDirectory(String uploadsDirectory) {
        this.uploadsDirectory = uploadsDirectory;
    }

    public boolean isMergeFormAttributes() {
        return mergeFormAttributes;
    }

    public void setMergeFormAttributes(boolean mergeFormAttributes) {
        this.mergeFormAttributes = mergeFormAttributes;
    }

    public boolean isDeleteUploadedFilesOnEnd() {
        return deleteUploadedFilesOnEnd;
    }

    public void setDeleteUploadedFilesOnEnd(boolean deleteUploadedFilesOnEnd) {
        this.deleteUploadedFilesOnEnd = deleteUploadedFilesOnEnd;
    }

    public boolean isPreallocateBodyBuffer() {
        return preallocateBodyBuffer;
    }

    public void setPreallocateBodyBuffer(boolean preallocateBodyBuffer) {
        this.preallocateBodyBuffer = preallocateBodyBuffer;
    }

    public boolean isHandleFileUploads() {
        return handleFileUploads;
    }

    public void setHandleFileUploads(boolean handleFileUploads) {
        this.handleFileUploads = handleFileUploads;
    }
}
